package cn.hesion.designpattern.Singleton;

import java.lang.reflect.Constructor;

public class LazySimpleSingletonTest {
    //    public static void main(String[] args) {
//        Thread t1 = new Thread(new ExectorThread());
//        Thread t2 = new Thread(new ExectorThread());
//        t1.start();
//        t2.start();
//        System.out.println("end");
//
//    }
    public static void main(String[] args) {
      try {
          Class<?> clazz = LazyInnerClassSingleton.class;
          Constructor<?> c = clazz.getDeclaredConstructor(null);
          c.setAccessible(true);

          Object o1 = c.newInstance();
          Object o2 = c.newInstance();
          System.out.println(o1==o2);
      }catch (Exception e){
          e.printStackTrace();
      }
    }
}
